<?php
/*
接收用户发送的token进行用户判断，并返回用户的信息
*/
header("Access-Control-Allow-Origin: *");
header("Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept");
header('Content-Type:application/json; charset=utf-8');

include_once '../public/con-db.php';
$res = file_get_contents('php://input');

$token = $_POST['token'];

$sql = "SELECT * FROM `student` WHERE `token`='$token'";
$result = $conn->query($sql);
$rows = mysqli_fetch_assoc($result);
print_r (json_encode($rows));

?>